/**
 * Created by Administrator on 2017/4/24.
 */
var SeamlessScroll = require('../../../../src/libs/seamless-scroll');
var NoticeScroller = React.createClass({
    getDefaultProps:function(){
        return{
            data: {
                notices:[],
                moreUrl: "",
                config: {
                    speed: 20,  //滚动速度
                    type: 2,    //1：无缝滚动，2：间歇滚动:只有向上滚动的场景
                    stopTime: 3000  //间歇滚动停顿时间
                }
            }
        }
    },
    render:function(){
        var notices = this.props.data.notices;
        var moreUrl = this.props.data.moreUrl;
        var config = this.props.data.config;
        return(
            <div className="mod-hot-news">
                <div className="bg"></div>
                <div className="wrap">
                    {notices.length > 0 ?
                        <div className="newsbox" id="newsbox">
                            <SeamlessScroll config={config}>
                                <ul>
                                    {
                                        notices.map(function (item, index) {
                                            return (
                                                <li>
                                                    <a href={item.LinkUrl}>{item.Title}</a><span>{item.CreateDate}</span>
                                                </li>
                                            )
                                        })
                                    }
                                </ul>
                            </SeamlessScroll>
                        </div> : ""
                    }
                    <div className="other-label"><a href={moreUrl}>查看更多公告 &gt;&gt;</a></div>
                </div>
            </div>
        )
    }
});
module.exports = NoticeScroller;